package com.shensi.api.admin.client.customer;

import com.shensi.api.admin.client.fallback.customer.CustomerElectronicCardClientFallBack;
import com.shensi.api.admin.domian.customer.dto.CustomerCardChangeDto;
import com.shensi.api.admin.domian.customer.dto.CustomerCardUseRecordDto;
import com.shensi.api.admin.domian.customer.dto.CustomerElectronicCardDto;
import com.shensi.api.admin.domian.customer.dto.UserBalanceForm;
import com.shensi.api.admin.domian.customer.vo.UserBalanceSumVO;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.domain.ResultData;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = CustomerElectronicCardClientFallBack.class)
@Component
public interface CustomerElectronicCardClient {

    /**
     * 查询客户电子会员卡（储蓄卡）列表
     */
    @GetMapping("/customer/card/list")
    public TableDataInfo list(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);

    /**
     * 导出客户电子会员卡（储蓄卡）列表
     */
    @GetMapping("/customer/card/export")
    public AjaxResult export(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);

    /**
     * 获取客户电子会员卡（储蓄卡）详细信息
     */
    @GetMapping(value = "/customer/card/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id);

    /**
     * 新增客户电子会员卡（储蓄卡）
     */
    @PostMapping
    public AjaxResult add(@RequestBody CustomerElectronicCardDto customerElectronicCard);

    /**
     * 修改客户电子会员卡（储蓄卡）
     */
    @PutMapping
    public AjaxResult edit(@RequestBody CustomerElectronicCardDto customerElectronicCard);

    /**
     * 删除客户电子会员卡（储蓄卡）
     */
    @DeleteMapping("/customer/card/{ids}")
    public AjaxResult remove(@PathVariable("ids") Long[] ids);
    /**
     * 查询电子会员数据
     */
    @GetMapping("/customer/card/listSum")
    public AjaxResult listSum(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);

    /**
     * 会员卡统计信息
     */
    @GetMapping("/customer/card/cardUserSum")
    public AjaxResult cardUserSum(@SpringQueryMap CustomerCardUseRecordDto customerCardUseRecord);


    @GetMapping("/customer/card/selectCard")
    public TableDataInfo selectCard(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);
    /**
     * 查询电子会员数据
     */
    @GetMapping("/customer/card/listHYData")
    public AjaxResult listHYData(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);


    /**
     * 查询电子会员数据
     */
    @GetMapping("/customer/card/listJRHYData")
    public AjaxResult listJRHYData(@SpringQueryMap CustomerElectronicCardDto customerElectronicCard);

    @GetMapping("/customer/card/user/list")
    public AjaxResult customerCardList(@RequestParam(value = "mobilePhone") String mobilePhone,
                                       @RequestParam(value = "enterpriseId") Long enterpriseId);

    @PostMapping("/customer/card/user/updateUserRecord")
    public AjaxResult updateUserReocrd(@RequestBody CustomerCardChangeDto customerCardChangeDto);

    @GetMapping("/customer/card/user/balance/list")
    public TableDataInfo userBalanceVOList(@SpringQueryMap UserBalanceForm form);

    @GetMapping("/customer/card/user/balance/sum")
    public ResultData<UserBalanceSumVO> userBalanceSum(@SpringQueryMap UserBalanceForm form);

}
